package com.artpri.action;

import java.util.Map;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;

import com.artpri.model.AdPicture;
import com.artpri.model.vo.SimpleGoods;
import com.artpri.service.AdPictureService.ImageState;

/**
 * 个人中心广告位
 * @author ZhangSi
 */
@Namespace("/page/selfCenter")
@ParentPackage("json-default")
public class SelfCenterPageAction extends BaseAction {

	private static final long serialVersionUID = -6409066984064316015L;

	private Map<String, AdPicture> adMap;
	
	private Map<String, SimpleGoods> recGoodsMap;
	
	@Action(value="selfCenterBottomAd", results={
			@Result(name="success", type="json", params={"root", "adMap"})
	})
	public String bottomAd() throws Exception {
		adMap = getAdPictureService().getAdPictureMapByPlate("00200", ImageState.SHOW);
		return SUCCESS;
	}

	@Action(value="selfCenterRecGoods", results={
			@Result(name="success", type="json", params={"root", "recGoodsMap"})
	})
	public String recGoods() throws Exception {
		recGoodsMap = getAdPictureService().getRecGoodsMapByPlate("00204", ImageState.SHOW);
		return SUCCESS;
	}
	
	public Map<String, AdPicture> getAdMap() {
		return adMap;
	}
	public void setAdMap(Map<String, AdPicture> adMap) {
		this.adMap = adMap;
	}
	public Map<String, SimpleGoods> getRecGoodsMap() {
		return recGoodsMap;
	}
	public void setRecGoodsMap(Map<String, SimpleGoods> recGoodsMap) {
		this.recGoodsMap = recGoodsMap;
	}
}
